import pandas as pd
import numpy as np
from scipy.optimize import curve_fit
from scipy.optimize import minimize
from scipy.optimize import least_squares
import matplotlib.pyplot as plt
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error
import scipy
from sqlalchemy import create_engine, inspect
from sqlalchemy.orm import sessionmaker
import datetime
import warnings
warnings.filterwarnings('ignore')
Para la base de datos se utiliza el servicio de https://neon.tech/, el cual se utiliza por integrar PostGIS sin costo y ofrecer una capacidad suficiente para pruebas.
db_url = "postgresql://test_owner:lpPrcHty8i9V@ep-royal-glitter-a50h4o6a.us-east-2.aws.neon.tech/test?sslmode=require"
engine = create_engine(db_url)
Se guardó toda la información de la Especie con identificador 1 para hacer pruebas.
query = "SELECT * FROM data_especie1;"
df = pd.read_sql_query(query, engine)
df
| PARCELA # | ROTACIÓN # | ZONA | AÑO PLANTACIÓN | EDAD | MEDICIÓN # | FECHA MEDICIÓN | ESPECIE | PROCEDENCIA GENÉTICA | ARBOL # | ... | DAP MEDIO [cm] | AREA BASAL [m2/ha] | H TOTAL [m] | H DOMINANTE [m] | H PODA [m] | N/ha PODADOS [#] | VOLUMEN EN PIÉ d.u. = 5 cm. [m3/ha scc]. | IMA s/raleo [m3/ha/año]. | Observación | Clasificacion Densidad | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 1004 | 2012 | 6.043836 | 2 | 2018-06-20 00:00:00 | 1 | Livingston HSCA T416 | 1 | ... | 17.229788 | 14.112918 | 9.768085 | 10.925 | 3.555319 | None | 51.132477 | 8.460269 | None | 3 |
| 1 | 1 | 1 | 1004 | 2012 | 6.043836 | 2 | 2018-06-20 00:00:00 | 1 | Livingston HSCA T416 | 2 | ... | 17.229788 | 14.112918 | 9.768085 | 10.925 | 3.555319 | None | 51.132477 | 8.460269 | None | 3 |
| 2 | 1 | 1 | 1004 | 2012 | 6.043836 | 2 | 2018-06-20 00:00:00 | 1 | Livingston HSCA T416 | 3 | ... | 17.229788 | 14.112918 | 9.768085 | 10.925 | 3.555319 | None | 51.132477 | 8.460269 | None | 3 |
| 3 | 1 | 1 | 1004 | 2012 | 6.043836 | 2 | 2018-06-20 00:00:00 | 1 | Livingston HSCA T416 | 4 | ... | 17.229788 | 14.112918 | 9.768085 | 10.925 | 3.555319 | None | 51.132477 | 8.460269 | None | 3 |
| 4 | 1 | 1 | 1004 | 2012 | 6.043836 | 2 | 2018-06-20 00:00:00 | 1 | Livingston HSCA T416 | 5 | ... | 17.229788 | 14.112918 | 9.768085 | 10.925 | 3.555319 | None | 51.132477 | 8.460269 | None | 3 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 383240 | 106 | 1 | 1004 | 2012 | 10.909589 | 7 | 2023-07-10 00:00:00 | 1 | HSCB R | 35 | ... | 28.300000 | 25.390000 | 17.600000 | 18.000 | 4.900000 | None | 173.100000 | 15.866775 | None | 2 |
| 383241 | 106 | 1 | 1004 | 2012 | 10.909589 | 7 | 2023-07-10 00:00:00 | 1 | HSCB R | 36 | ... | 28.300000 | 25.390000 | 17.600000 | 18.000 | 4.900000 | None | 173.100000 | 15.866775 | None | 2 |
| 383242 | 106 | 1 | 1004 | 2012 | 10.909589 | 7 | 2023-07-10 00:00:00 | 1 | HSCB R | 37 | ... | 28.300000 | 25.390000 | 17.600000 | 18.000 | 4.900000 | None | 173.100000 | 15.866775 | None | 2 |
| 383243 | 106 | 1 | 1004 | 2012 | 10.909589 | 7 | 2023-07-10 00:00:00 | 1 | HSCB R | 38 | ... | 28.300000 | 25.390000 | 17.600000 | 18.000 | 4.900000 | None | 173.100000 | 15.866775 | None | 2 |
| 383244 | 106 | 1 | 1004 | 2012 | 10.909589 | 7 | 2023-07-10 00:00:00 | 1 | HSCB R | 39 | ... | 28.300000 | 25.390000 | 17.600000 | 18.000 | 4.900000 | None | 173.100000 | 15.866775 | None | 2 |
383245 rows × 42 columns
Para el crecimiento se definieron 12 modelos de crecimiento. El ejercicio consiste en encontrar, a partir de los datos, los mejores valores constantes para cada modelo.
#Sweda
#N(t) = N0 * e^(r(t-t0))
def SWEDA(x,N0,r,t0):
return N0 * np.exp(r*(x - t0))
#return x * N0
#La fórmula para el modelo de crecimiento de Gompertz es la siguiente:
#N(t) = N0 * e^(-a * e^(-bt))
def GOMPERTZ(x,N0,a,b):
return N0 * np.exp(-a * np.exp(-b * x))
#La función logística se puede escribir de la siguiente manera:#
#N(t) = K / (1 + ae^(-rt))
def LOGISTICA(x,k,a,r):
return k / (1 + a * np.exp(-r * x))
def SIGMOID(x, L, k ,x0):
"""
Modelo sigmoidal (función logística).
Parámetros:
- x: Array de valores independientes.
- L: Límite superior de la curva.
- x0: Punto medio de la curva en el eje x.
- k: Pendiente de la curva en el punto medio.
Retorna:
- Array con los valores de la función sigmoidal para cada valor de x.
"""
return L / (1 + np.exp(-k * (x - x0)))
def GOMPERTZ(x,N0,a,b):
return N0 * np.exp(-a * np.exp(-b * x))
def GOMPERTZ2(x,N0,p,b):
return N0 * np.exp(- np.exp(p -b * x))
def relacionPolimorfica(x,a,b,c):
return a * ( 1 - np.exp( -b * x)) ** c
def MITSCHERLICH(x,a,L,b):
return a * ( 1 - L* np.exp( -b * x))
#
def ChapmanRichards(x,a,b,c):
return a * (1 -np.exp( -b * x)) ** c + np.exp(1)
def HossfeldI(x,a,b,c):
return ((x ** 2) / (a + b*x) ** 2) + np.exp(1)
def Schumacher(x,a,b,c):
return a * np.exp(-b * ( 1/ x)) + np.exp(1)
def Weibull(x,a,b,c):
return a * ( 1 - np.exp( -b * x ** c)) + np.exp(1)
En esta sección se definen un conjunto de funciones para encontrar el mejor modelo:
def evaluar_modelo(funcion, X, Y,popt):
predicciones = funcion(X, *popt)
# Calcular métricas básicas
mse = mean_squared_error(Y, predicciones)
r2 = r2_score(Y, predicciones)
mae = mean_absolute_error(Y, predicciones)
mape = np.mean(np.abs((Y - predicciones) / Y)) * 100
std_residuos = np.std(Y - predicciones)
# Otras métricas adicionales
suma_residuos_abs = np.sum(np.abs(Y - predicciones))
max_error_abs = np.max(np.abs(Y - predicciones))
mean_error_abs = np.mean(np.abs(Y - predicciones))
# Métricas adicionales
suma_residuos_cuad = np.sum((Y - predicciones)**2)
mediana_residuos = np.median(Y - predicciones)
percentil_90 = np.percentile(Y - predicciones, 90)
varianza_residuos = np.var(Y - predicciones)
suma_cuad_residual_abs = np.sum(np.abs((Y - predicciones)) ** 2)
min_error_abs = np.min(np.abs(Y - predicciones))
skew_residuos = scipy.stats.skew(Y - predicciones)
kurtosis_residuos = scipy.stats.kurtosis(Y - predicciones)
coef_variacion_residuos = np.std(Y - predicciones) / np.mean(Y - predicciones)
error_cuadratico_medio = np.sqrt(np.mean((Y - predicciones) ** 2))
metricas = {
"MSE": mse,
"R2": r2,
"MAE": mae,
"MAPE": mape,
"STD Residuos": std_residuos,
"Suma Residuos Abs": suma_residuos_abs,
"Max Error Abs": max_error_abs,
"Mean Error Abs": mean_error_abs,
"Suma Residuos Cuadráticos": suma_residuos_cuad,
"Mediana Residuos": mediana_residuos,
"Percentil 90": percentil_90,
"Varianza Residuos": varianza_residuos,
"Suma Cuadrada de los Residuos Absolutos": suma_cuad_residual_abs,
"Min Error Abs": min_error_abs,
"Skewness de los Residuos": skew_residuos,
"Kurtosis de los Residuos": kurtosis_residuos,
"Coeficiente de Variación de los Residuos": coef_variacion_residuos,
"Error Cuadrático Medio": error_cuadratico_medio
}
return metricas
def getMinimosCuadrados(funcion,X,Y):
def residuals(params, x, y):
return y - funcion(x, *params)
initial_guess = [1,1,1]
result = least_squares(residuals, initial_guess, args=(X, Y))
N0, t0, r = result.x
return result.x
# Establecer la visualización en línea y mejorar la calidad de la imagen
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
def getGrafico2(funcion, X, Y):
# Generar puntos para el ajuste
t_fit = np.linspace(min(X), max(X), 100)
# Obtener los parámetros del ajuste
a,b,c = getMinimosCuadrados(funcion,X,Y)
print(funcion.__name__,a,b,c)
# Evaluar la función ajustada en los puntos de ajuste
metricas = evaluar_modelo(funcion, X, Y,[a,b,c])
N_fit = funcion(t_fit,a,b,c)
# Plotear los datos y el ajuste
plt.figure(figsize=(15, 9)) # Tamaño de la figura
plt.scatter(X, Y, color='blue', label='Datos') # Plotear los datos
plt.plot(t_fit, N_fit, 'r-', label=f'Ajuste {funcion.__name__}') # Plotear el ajuste
plt.xlabel('Tiempo [Años]')
plt.ylabel('DAP [mm]')
plt.legend()
plt.grid(True) # Agregar una rejilla
plt.title('Gráfico de Ajuste') # Título del gráfico
plt.tight_layout() # Ajustar el diseño de la figura para evitar superposiciones
plt.show()
# Obtener métricas del modelo
#metricas = evaluar_modelo(funcion, X, Y, params)
metricas["Funcion"] = funcion.__name__
metricas["b0"] = a
metricas["b1"] = b
metricas["b2"] = c
return metricas
def MODELOS2(X,Y):
d1 = getGrafico2(SWEDA,X,Y)
d2 = getGrafico2(GOMPERTZ,X,Y)
d3 = getGrafico2(LOGISTICA,X,Y)
d4 = getGrafico2(SIGMOID,X,Y)
d5 = getGrafico2(GOMPERTZ2,X,Y)
d6 = getGrafico2(relacionPolimorfica,X,Y)
d7 = getGrafico2(MITSCHERLICH,X,Y)
d8 = getGrafico2(ChapmanRichards,X,Y)
d9 = getGrafico2(HossfeldI,X,Y)
d10 =getGrafico2(Schumacher,X,Y)
d11 =getGrafico2(Weibull,X,Y)
return [d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11]
dfClean = df[['Clasificacion Densidad','EDAD','DAP [mm]']].dropna()
Esta es la parte del proceso más larga y que requiere mayor capacidad de cómputo.
acumulador = []
for i in dfClean['Clasificacion Densidad'].sort_values().unique():
print(i)
aux2 = dfClean[dfClean['Clasificacion Densidad'] == i]
auxX = np.array(aux2['EDAD'])
auxY = np.array(aux2['DAP [mm]'])
data = pd.DataFrame(MODELOS2(auxX,auxY))
data["Clasificacion Densidad"] = i
acumulador.append(data.copy())
errores = pd.concat(acumulador)
errores["Fecha_Analisis"] = datetime.datetime.now()
1 SWEDA 21.04119438647293 0.046419999139448886 7.10587799699723
GOMPERTZ 38.46327179557505 1.725621174054583 0.13785611393744854
LOGISTICA 37.032921601250976 3.2109256850486454 0.18705747048150667
SIGMOID 37.03315033104063 0.18705474512879688 6.236430348041789
GOMPERTZ2 38.46292029061756 0.5455947007342655 0.13785926728915074
relacionPolimorfica 44.160254594609384 0.0685756872552295 0.8134078716935539
MITSCHERLICH 41.366632283607444 0.9515908033103654 0.08787302045324784
ChapmanRichards 40.27005479755286 0.07826878248230645 0.9718266320152252
HossfeldI -0.6570581261937979 -0.1451961919079237 1.0
Schumacher 41.20107176680019 5.904595978915142 1.0
Weibull 41.09688061447227 0.08410061768487219 0.9664273943593613
2 SWEDA 26.7977474340287 0.04110951259995371 13.048828986525129
GOMPERTZ 32.847986171835934 1.869889046079423 0.19266388154042485
LOGISTICA 32.141472777929074 3.3644651051822088 0.24631612894827698
SIGMOID 32.141771309157946 0.24630685128190405 4.925693583241155
GOMPERTZ2 32.848188294752504 0.6258605254777986 0.19265915728445182
relacionPolimorfica 34.28552153982284 0.136328592007583 1.0709550122297369
MITSCHERLICH 34.097155236975155 1.0558302640322947 0.13786677039164807
ChapmanRichards 31.26552742874629 0.1463990049759853 1.2905145343274544
HossfeldI -0.5817228932128627 -0.15437065403552702 1.0
Schumacher 37.96821614948784 5.278386914371598 1.0
Weibull 31.173854585170137 0.0908874727180461 1.1377413194383494
3 SWEDA 7.904541477173488 0.046135017604025 -12.430984779173226
GOMPERTZ 27.417885945664782 2.7638464263107916 0.32492181842807744
LOGISTICA 27.010507377448942 5.559957955963131 0.4122874924427619
SIGMOID 27.010719004217545 0.41227226785021376 4.161162055555551
GOMPERTZ2 27.417877119669665 1.016625096151718 0.32492228697995723
relacionPolimorfica 27.866471749517146 0.27097624749715055 1.8579808791121428
MITSCHERLICH 28.155896614641886 1.3943535166740737 0.23578544655074993
ChapmanRichards 24.995769323947336 0.2891011771224708 2.361427329151902
HossfeldI 0.5270164563515811 0.16431834813746068 1.0
Schumacher 33.74423906381523 4.552423272287056 1.0
Weibull 24.732302633914294 0.06866740552596795 1.5004337935160004
4 SWEDA 10.948717094242452 0.04683918531239231 -2.1448902246631403
GOMPERTZ 24.63496096817586 2.5143897687622228 0.3118923717541098
LOGISTICA 24.302494065552892 5.435856801380573 0.40875746568228505
SIGMOID 24.302477433229928 0.40876076941455314 4.14186312703919
GOMPERTZ2 24.63492292473125 0.9220467561699824 0.3118966657815703
relacionPolimorfica 24.94745344909214 0.2571809181970153 1.633911218260609
MITSCHERLICH 25.200635532325702 1.266753195231155 0.22489617520766764
ChapmanRichards 22.08005829602988 0.2800462415621691 2.186642932784332
HossfeldI -0.5454844361071061 -0.17891782223103614 1.0
Schumacher 28.663112017828087 4.303202211625802 1.0
Weibull 21.702974607934003 0.06896985555569726 1.5081035460834373
5 SWEDA 18.23370649645544 0.013214082468090027 -2.934876255408325
GOMPERTZ 235.92070008524024 2.528636175352281 0.005647884883983733
LOGISTICA 118325.71013388612 6241.5346777196 0.013216350853996296
SIGMOID 699.614709769813 0.013658047404298507 262.2294850829726
GOMPERTZ2 164.6892201707684 0.7749999929759537 0.006672715370908827
relacionPolimorfica 72.08409580568882 0.00015224729655643197 0.18693111266696805
MITSCHERLICH 150.6947713938416 0.8769853033387759 0.0023475514379820784
ChapmanRichards 72.0159104663412 0.0001759500464682113 0.2123818143589132
HossfeldI -0.3328710561882554 -0.19915040073010296 1.0
Schumacher 24.888062914706094 2.9745310123974367 1.0
Weibull 83.2311987722169 0.14516978472886896 0.24416362612564754
errores
| MSE | R2 | MAE | MAPE | STD Residuos | Suma Residuos Abs | Max Error Abs | Mean Error Abs | Suma Residuos Cuadráticos | Mediana Residuos | ... | Skewness de los Residuos | Kurtosis de los Residuos | Coeficiente de Variación de los Residuos | Error Cuadrático Medio | Funcion | b0 | b1 | b2 | Clasificacion Densidad | Fecha_Analisis | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 27.558134 | 0.468702 | 4.029327 | 17.917199 | 5.249462 | 12434.504221 | 25.503244 | 4.029327 | 8.504440e+04 | -0.300545 | ... | 0.368386 | 1.467820 | -1.467915e+02 | 5.249584 | SWEDA | 21.041194 | 0.046420 | 7.105878 | 1 | 2024-05-02 17:10:38.800778 |
| 1 | 24.920378 | 0.519556 | 3.803969 | 16.033188 | 4.992028 | 11739.048860 | 24.255991 | 3.803969 | 7.690429e+04 | -0.309014 | ... | 0.386523 | 1.732474 | -8.306736e+02 | 4.992031 | GOMPERTZ | 38.463272 | 1.725621 | 0.137856 | 1 | 2024-05-02 17:10:38.800778 |
| 2 | 25.099417 | 0.516104 | 3.824390 | 16.227436 | 5.009920 | 11802.066760 | 24.268368 | 3.824390 | 7.745680e+04 | -0.294159 | ... | 0.381045 | 1.697224 | -4.531408e+02 | 5.009932 | LOGISTICA | 37.032922 | 3.210926 | 0.187057 | 1 | 2024-05-02 17:10:38.800778 |
| 3 | 25.099417 | 0.516104 | 3.824391 | 16.227448 | 5.009920 | 11802.069612 | 24.268388 | 3.824391 | 7.745680e+04 | -0.294147 | ... | 0.381043 | 1.697223 | -4.531715e+02 | 5.009932 | SIGMOID | 37.033150 | 0.187055 | 6.236430 | 1 | 2024-05-02 17:10:38.800778 |
| 4 | 24.920378 | 0.519556 | 3.803968 | 16.033172 | 4.992028 | 11739.045338 | 24.255969 | 3.803968 | 7.690429e+04 | -0.308969 | ... | 0.386525 | 1.732475 | -8.306188e+02 | 4.992031 | GOMPERTZ2 | 38.462920 | 0.545595 | 0.137859 | 1 | 2024-05-02 17:10:38.800778 |
| 5 | 24.692280 | 0.523954 | 3.777398 | 15.808899 | 4.969129 | 11657.049170 | 24.326984 | 3.777398 | 7.620038e+04 | -0.262152 | ... | 0.398153 | 1.787827 | -8.413321e+02 | 4.969133 | relacionPolimorfica | 44.160255 | 0.068576 | 0.813408 | 1 | 2024-05-02 17:10:38.800778 |
| 6 | 24.727972 | 0.523266 | 3.779970 | 15.795186 | 4.972723 | 11664.988869 | 24.263190 | 3.779970 | 7.631052e+04 | -0.236278 | ... | 0.391794 | 1.774221 | 7.188269e+06 | 4.972723 | MITSCHERLICH | 41.366632 | 0.951591 | 0.087873 | 1 | 2024-05-02 17:10:38.800778 |
| 7 | 24.730752 | 0.523212 | 3.782651 | 15.864034 | 4.972995 | 11673.260247 | 24.324262 | 3.782651 | 7.631910e+04 | -0.287542 | ... | 0.397526 | 1.779102 | -5.878602e+02 | 4.973002 | ChapmanRichards | 40.270055 | 0.078269 | 0.971827 | 1 | 2024-05-02 17:10:38.800778 |
| 8 | 24.684556 | 0.524103 | 3.771243 | 15.669904 | 4.968355 | 11638.056309 | 24.195639 | 3.771243 | 7.617654e+04 | -0.198491 | ... | 0.401314 | 1.786289 | 2.991313e+03 | 4.968355 | HossfeldI | -0.657058 | -0.145196 | 1.000000 | 1 | 2024-05-02 17:10:38.800778 |
| 9 | 24.873829 | 0.520454 | 3.782467 | 15.595337 | 4.987348 | 11672.694631 | 24.035584 | 3.782467 | 7.676064e+04 | -0.173106 | ... | 0.413218 | 1.758948 | 3.638694e+02 | 4.987367 | Schumacher | 41.201072 | 5.904596 | 1.000000 | 1 | 2024-05-02 17:10:38.800778 |
| 10 | 24.728393 | 0.523257 | 3.782949 | 15.876494 | 4.972754 | 11674.181161 | 24.340027 | 3.782949 | 7.631182e+04 | -0.284092 | ... | 0.399331 | 1.781259 | -4.749267e+02 | 4.972765 | Weibull | 41.096881 | 0.084101 | 0.966427 | 1 | 2024-05-02 17:10:38.800778 |
| 0 | 20.924974 | 0.487241 | 3.592854 | 16.304069 | 4.574298 | 718797.055767 | 26.633854 | 3.592854 | 4.186313e+06 | -0.081531 | ... | 0.051921 | 0.441579 | -1.643146e+02 | 4.574382 | SWEDA | 26.797747 | 0.041110 | 13.048829 | 2 | 2024-05-02 17:10:38.800778 |
| 1 | 17.754864 | 0.564924 | 3.274430 | 14.064290 | 4.213650 | 655092.213581 | 29.536489 | 3.274430 | 3.552091e+06 | -0.091188 | ... | 0.166082 | 0.705193 | -1.045561e+03 | 4.213652 | GOMPERTZ | 32.847986 | 1.869889 | 0.192664 | 2 | 2024-05-02 17:10:38.800778 |
| 2 | 17.891695 | 0.561571 | 3.290563 | 14.190144 | 4.229850 | 658319.996740 | 29.685534 | 3.290563 | 3.579466e+06 | -0.107287 | ... | 0.171539 | 0.688954 | -5.148588e+02 | 4.229858 | LOGISTICA | 32.141473 | 3.364465 | 0.246316 | 2 | 2024-05-02 17:10:38.800778 |
| 3 | 17.891695 | 0.561571 | 3.290564 | 14.190167 | 4.229850 | 658320.199993 | 29.685372 | 3.290564 | 3.579466e+06 | -0.107241 | ... | 0.171530 | 0.688944 | -5.149224e+02 | 4.229858 | SIGMOID | 32.141771 | 0.246307 | 4.925694 | 2 | 2024-05-02 17:10:38.800778 |
| 4 | 17.754864 | 0.564924 | 3.274430 | 14.064303 | 4.213650 | 655092.312741 | 29.536401 | 3.274430 | 3.552091e+06 | -0.091188 | ... | 0.166078 | 0.705188 | -1.045660e+03 | 4.213652 | GOMPERTZ2 | 32.848188 | 0.625861 | 0.192659 | 2 | 2024-05-02 17:10:38.800778 |
| 5 | 17.637967 | 0.567788 | 3.260695 | 13.971160 | 4.199756 | 652344.418822 | 29.286243 | 3.260695 | 3.528705e+06 | -0.085934 | ... | 0.160186 | 0.717183 | -1.107633e+03 | 4.199758 | relacionPolimorfica | 34.285522 | 0.136329 | 1.070955 | 2 | 2024-05-02 17:10:38.800778 |
| 6 | 17.627509 | 0.568044 | 3.259151 | 13.940096 | 4.198513 | 652035.611462 | 29.352917 | 3.259151 | 3.526612e+06 | -0.072926 | ... | 0.159743 | 0.721301 | 4.776386e+07 | 4.198513 | MITSCHERLICH | 34.097155 | 1.055830 | 0.137867 | 2 | 2024-05-02 17:10:38.800778 |
| 7 | 17.662900 | 0.567177 | 3.263816 | 13.999101 | 4.202722 | 652968.891346 | 29.320816 | 3.263816 | 3.533693e+06 | -0.093254 | ... | 0.161616 | 0.713528 | -7.593367e+02 | 4.202725 | ChapmanRichards | 31.265527 | 0.146399 | 1.290515 | 2 | 2024-05-02 17:10:38.800778 |
| 8 | 17.618006 | 0.568277 | 3.259083 | 14.008167 | 4.197362 | 652022.015258 | 28.857013 | 3.259083 | 3.524711e+06 | -0.110547 | ... | 0.154491 | 0.712372 | -3.361600e+02 | 4.197381 | HossfeldI | -0.581723 | -0.154371 | 1.000000 | 2 | 2024-05-02 17:10:38.800778 |
| 9 | 17.558918 | 0.569725 | 3.251401 | 13.868991 | 4.190336 | 650485.088840 | 29.338565 | 3.251401 | 3.512890e+06 | -0.060965 | ... | 0.163964 | 0.734157 | 5.770884e+03 | 4.190336 | Schumacher | 37.968216 | 5.278387 | 1.000000 | 2 | 2024-05-02 17:10:38.800778 |
| 10 | 17.679527 | 0.566770 | 3.266090 | 14.029858 | 4.204694 | 653423.704274 | 29.272784 | 3.266090 | 3.537019e+06 | -0.100046 | ... | 0.161674 | 0.709074 | -4.867760e+02 | 4.204703 | Weibull | 31.173855 | 0.090887 | 1.137741 | 2 | 2024-05-02 17:10:38.800778 |
| 0 | 18.027486 | 0.431650 | 3.313443 | 20.391162 | 4.245769 | 354114.328696 | 24.570367 | 3.313443 | 1.926633e+06 | 0.094131 | ... | -0.182258 | 0.507175 | -1.390072e+02 | 4.245879 | SWEDA | 7.904541 | 0.046135 | -12.430985 | 3 | 2024-05-02 17:10:38.800778 |
| 1 | 13.464436 | 0.575508 | 2.843233 | 15.995061 | 3.669387 | 303861.962689 | 24.473881 | 2.843233 | 1.438971e+06 | 0.061531 | ... | -0.062884 | 0.770560 | -6.198001e+02 | 3.669392 | GOMPERTZ | 27.417886 | 2.763846 | 0.324922 | 3 | 2024-05-02 17:10:38.800778 |
| 2 | 13.630683 | 0.570267 | 2.863779 | 16.227922 | 3.691956 | 306057.764521 | 23.966998 | 2.863779 | 1.456738e+06 | 0.043996 | ... | -0.053009 | 0.737879 | -3.070714e+02 | 3.691976 | LOGISTICA | 27.010507 | 5.559958 | 0.412287 | 3 | 2024-05-02 17:10:38.800778 |
| 3 | 13.630683 | 0.570267 | 2.863780 | 16.227966 | 3.691956 | 306057.864109 | 23.966852 | 2.863780 | 1.456738e+06 | 0.043962 | ... | -0.053019 | 0.737873 | -3.071021e+02 | 3.691976 | SIGMOID | 27.010719 | 0.412272 | 4.161162 | 3 | 2024-05-02 17:10:38.800778 |
| 4 | 13.464436 | 0.575508 | 2.843233 | 15.995059 | 3.669387 | 303861.960847 | 24.473886 | 2.843233 | 1.438971e+06 | 0.061530 | ... | -0.062883 | 0.770560 | -6.198033e+02 | 3.669392 | GOMPERTZ2 | 27.417877 | 1.016625 | 0.324922 | 3 | 2024-05-02 17:10:38.800778 |
| 5 | 13.381291 | 0.578130 | 2.833141 | 15.907482 | 3.658040 | 302783.494350 | 24.644897 | 2.833141 | 1.430085e+06 | 0.056667 | ... | -0.068576 | 0.786023 | -6.372605e+02 | 3.658045 | relacionPolimorfica | 27.866472 | 0.270976 | 1.857981 | 3 | 2024-05-02 17:10:38.800778 |
| 6 | 13.315753 | 0.580196 | 2.825794 | 15.790662 | 3.649076 | 301998.256407 | 25.033095 | 2.825794 | 1.423081e+06 | 0.066861 | ... | -0.072811 | 0.800751 | 7.850994e+09 | 3.649076 | MITSCHERLICH | 28.155897 | 1.394354 | 0.235785 | 3 | 2024-05-02 17:10:38.800778 |
| 7 | 13.420908 | 0.576881 | 2.837977 | 15.970967 | 3.663444 | 303300.271140 | 24.482108 | 2.837977 | 1.434319e+06 | 0.054823 | ... | -0.065801 | 0.776998 | -3.975777e+02 | 3.663456 | ChapmanRichards | 24.995769 | 0.289101 | 2.361427 | 3 | 2024-05-02 17:10:38.800778 |
| 8 | 13.812197 | 0.564544 | 2.886365 | 16.708567 | 3.716255 | 308471.565983 | 23.628713 | 2.886365 | 1.476137e+06 | -0.015858 | ... | -0.077432 | 0.731722 | -9.168369e+01 | 3.716476 | HossfeldI | 0.527016 | 0.164318 | 1.000000 | 3 | 2024-05-02 17:10:38.800778 |
| 9 | 13.441056 | 0.576245 | 2.839517 | 16.132440 | 3.666146 | 303464.907904 | 23.920111 | 2.839517 | 1.436473e+06 | 0.015731 | ... | -0.083088 | 0.789841 | -1.763321e+02 | 3.666205 | Schumacher | 33.744239 | 4.552423 | 1.000000 | 3 | 2024-05-02 17:10:38.800778 |
| 10 | 13.511164 | 0.574035 | 2.848940 | 16.137520 | 3.675713 | 304471.949697 | 24.046107 | 2.848940 | 1.443965e+06 | 0.037299 | ... | -0.062217 | 0.760439 | -2.137498e+02 | 3.675754 | Weibull | 24.732303 | 0.068667 | 1.500434 | 3 | 2024-05-02 17:10:38.800778 |
| 0 | 22.768430 | 0.407441 | 3.717773 | 21.285520 | 4.771564 | 36151.621336 | 21.742487 | 3.717773 | 2.214002e+05 | 0.258657 | ... | -0.317167 | 0.598934 | -1.939608e+02 | 4.771628 | SWEDA | 10.948717 | 0.046839 | -2.144890 | 4 | 2024-05-02 17:10:38.800778 |
| 1 | 19.708693 | 0.487072 | 3.314354 | 17.742434 | 4.439447 | 32228.780910 | 25.748176 | 3.314354 | 1.916473e+05 | 0.168855 | ... | -0.380165 | 1.316759 | -1.192095e+04 | 4.439447 | GOMPERTZ | 24.634961 | 2.514390 | 0.311892 | 4 | 2024-05-02 17:10:38.800778 |
| 2 | 19.728109 | 0.486566 | 3.316106 | 17.751314 | 4.441633 | 32245.809967 | 25.716544 | 3.316106 | 1.918361e+05 | 0.142441 | ... | -0.372837 | 1.312863 | -2.928909e+03 | 4.441634 | LOGISTICA | 24.302494 | 5.435857 | 0.408757 | 4 | 2024-05-02 17:10:38.800778 |
| 3 | 19.728109 | 0.486566 | 3.316106 | 17.751312 | 4.441633 | 32245.813457 | 25.716568 | 3.316106 | 1.918361e+05 | 0.142413 | ... | -0.372836 | 1.312863 | -2.929713e+03 | 4.441634 | SIGMOID | 24.302477 | 0.408761 | 4.141863 | 4 | 2024-05-02 17:10:38.800778 |
| 4 | 19.708693 | 0.487072 | 3.314355 | 17.742433 | 4.439447 | 32228.788303 | 25.748212 | 3.314355 | 1.916473e+05 | 0.168858 | ... | -0.380163 | 1.316758 | -1.193594e+04 | 4.439447 | GOMPERTZ2 | 24.634923 | 0.922047 | 0.311897 | 4 | 2024-05-02 17:10:38.800778 |
| 5 | 19.702847 | 0.487224 | 3.314296 | 17.743217 | 4.438789 | 32228.212683 | 25.751296 | 3.314296 | 1.915905e+05 | 0.170144 | ... | -0.383236 | 1.316235 | -2.660372e+04 | 4.438789 | relacionPolimorfica | 24.947453 | 0.257181 | 1.633911 | 4 | 2024-05-02 17:10:38.800778 |
| 6 | 19.702088 | 0.487244 | 3.314675 | 17.745090 | 4.438703 | 32231.900955 | 25.752987 | 3.314675 | 1.915831e+05 | 0.182895 | ... | -0.384442 | 1.314700 | 3.119356e+08 | 4.438703 | MITSCHERLICH | 25.200636 | 1.266753 | 0.224896 | 4 | 2024-05-02 17:10:38.800778 |
| 7 | 19.704387 | 0.487184 | 3.314147 | 17.742788 | 4.438962 | 32226.762725 | 25.748109 | 3.314147 | 1.916055e+05 | 0.163644 | ... | -0.382019 | 1.316798 | -9.929461e+03 | 4.438962 | ChapmanRichards | 22.080058 | 0.280046 | 2.186643 | 4 | 2024-05-02 17:10:38.800778 |
| 8 | 19.971276 | 0.480238 | 3.353096 | 18.226032 | 4.468841 | 32605.502243 | 24.637879 | 3.353096 | 1.942007e+05 | 0.139372 | ... | -0.388635 | 1.232937 | -1.650379e+02 | 4.468923 | HossfeldI | -0.545484 | -0.178918 | 1.000000 | 4 | 2024-05-02 17:10:38.800778 |
| 9 | 19.768027 | 0.485528 | 3.320928 | 17.869996 | 4.446113 | 32292.707937 | 25.271326 | 3.320928 | 1.922243e+05 | 0.162979 | ... | -0.397631 | 1.299004 | -4.300907e+02 | 4.446125 | Schumacher | 28.663112 | 4.303202 | 1.000000 | 4 | 2024-05-02 17:10:38.800778 |
| 10 | 19.725199 | 0.486642 | 3.315182 | 17.757861 | 4.441305 | 32236.830738 | 25.658915 | 3.315182 | 1.918078e+05 | 0.142658 | ... | -0.377916 | 1.314088 | -1.232914e+03 | 4.441306 | Weibull | 21.702975 | 0.068970 | 1.508104 | 4 | 2024-05-02 17:10:38.800778 |
| 0 | 19.617978 | 0.008276 | 3.463919 | 17.266988 | 4.429219 | 4406.104867 | 20.011502 | 3.463919 | 2.495407e+04 | 0.135984 | ... | -0.344739 | 0.549655 | 3.378173e+04 | 4.429219 | SWEDA | 18.233706 | 0.013214 | -2.934876 | 5 | 2024-05-02 17:10:38.800778 |
| 1 | 19.618835 | 0.008232 | 3.463991 | 17.266922 | 4.429315 | 4406.196400 | 20.010917 | 3.463991 | 2.495516e+04 | 0.135840 | ... | -0.344706 | 0.549592 | 6.360034e+03 | 4.429315 | GOMPERTZ | 235.920700 | 2.528636 | 0.005648 | 5 | 2024-05-02 17:10:38.800778 |
| 2 | 19.617978 | 0.008276 | 3.463919 | 17.266992 | 4.429219 | 4406.104457 | 20.011487 | 3.463919 | 2.495407e+04 | 0.135981 | ... | -0.344739 | 0.549655 | 3.564685e+04 | 4.429219 | LOGISTICA | 118325.710134 | 6241.534678 | 0.013216 | 5 | 2024-05-02 17:10:38.800778 |
| 3 | 19.618046 | 0.008272 | 3.463923 | 17.267025 | 4.429226 | 4406.109822 | 20.011394 | 3.463923 | 2.495415e+04 | 0.135903 | ... | -0.344736 | 0.549651 | 4.023631e+04 | 4.429226 | SIGMOID | 699.614710 | 0.013658 | 262.229485 | 5 | 2024-05-02 17:10:38.800778 |
| 4 | 19.618994 | 0.008224 | 3.464038 | 17.266181 | 4.429333 | 4406.256430 | 20.011946 | 3.464038 | 2.495536e+04 | 0.136995 | ... | -0.344700 | 0.549578 | 2.255960e+03 | 4.429333 | GOMPERTZ2 | 164.689220 | 0.775000 | 0.006673 | 5 | 2024-05-02 17:10:38.800778 |
| 5 | 19.628327 | 0.007753 | 3.464777 | 17.270822 | 4.430387 | 4407.196797 | 20.009689 | 3.464777 | 2.496723e+04 | 0.123187 | ... | -0.344512 | 0.549678 | 6.286813e+03 | 4.430387 | relacionPolimorfica | 72.084096 | 0.000152 | 0.186931 | 5 | 2024-05-02 17:10:38.800778 |
| 6 | 19.620314 | 0.008158 | 3.464086 | 17.267345 | 4.429482 | 4406.317166 | 20.009021 | 3.464086 | 2.495704e+04 | 0.134767 | ... | -0.344650 | 0.549480 | 5.623966e+03 | 4.429482 | MITSCHERLICH | 150.694771 | 0.876985 | 0.002348 | 5 | 2024-05-02 17:10:38.800778 |
| 7 | 19.628069 | 0.007766 | 3.464760 | 17.270828 | 4.430358 | 4407.175108 | 20.009945 | 3.464760 | 2.496690e+04 | 0.123203 | ... | -0.344522 | 0.549701 | 7.630526e+03 | 4.430358 | ChapmanRichards | 72.015910 | 0.000176 | 0.212382 | 5 | 2024-05-02 17:10:38.800778 |
| 8 | 19.637312 | 0.007298 | 3.465495 | 17.274856 | 4.431401 | 4408.109610 | 20.007648 | 3.465495 | 2.497866e+04 | 0.117579 | ... | -0.344319 | 0.549698 | 5.590639e+04 | 4.431401 | HossfeldI | -0.332871 | -0.199150 | 1.000000 | 5 | 2024-05-02 17:10:38.800778 |
| 9 | 19.638365 | 0.007245 | 3.465557 | 17.275199 | 4.431519 | 4408.188310 | 20.005824 | 3.465557 | 2.498000e+04 | 0.121227 | ... | -0.344272 | 0.549576 | 8.920082e+04 | 4.431519 | Schumacher | 24.888063 | 2.974531 | 1.000000 | 5 | 2024-05-02 17:10:38.800778 |
| 10 | 19.628426 | 0.007748 | 3.464769 | 17.271172 | 4.430398 | 4407.185879 | 20.009102 | 3.464769 | 2.496736e+04 | 0.122584 | ... | -0.344509 | 0.549674 | 2.255647e+04 | 4.430398 | Weibull | 83.231199 | 0.145170 | 0.244164 | 5 | 2024-05-02 17:10:38.800778 |
55 rows × 24 columns
errores.to_sql("data_error", engine, if_exists='append', index=False)
55